---
description: "Reference for Nitric's v0 Go library - Creates a new Schedule to run a function on a defined frequency."
---

# Go - NewSchedule()

Creates a new Schedule to run a function on a defined frequency.

```go
import (
  "fmt"

  "github.com/nitrictech/go-sdk/faas"
  "github.com/nitrictech/go-sdk/nitric"
)

func main() {
  nitric.NewSchedule("aggregate-data").Every("3 days", func(ctx *faas.EventContext, _ faas.EventHandler) (*faas.EventContext, error) {
    fmt.Println("aggregating data")

    return ctx, nil
  })

  nitric.Run()
}
```

## Parameters

<Properties>
  <Property name="description" required type="string">
    The unique name of this Schedule within the app. Subsequent calls to
    `schedule` with the same name will return the same object.
  </Property>
</Properties>

### Notes

- Schedules do not require access permissions to be specified.

- During local development schedules can be triggered manually from the local development dashboard

## Examples

### Create a Schedule

```go
import (
  "fmt"

  "github.com/nitrictech/go-sdk/faas"
  "github.com/nitrictech/go-sdk/nitric"
)

func main() {
  nitric.NewSchedule("send-reminder").Every("1 day", func(ctx *faas.EventContext, _ faas.EventHandler) (*faas.EventContext, error) {
    fmt.Println("sending data")

    return ctx, nil
  })

  nitric.NewSchedule("archive-data").Cron("0 1 1 * *", func (ctx *faas.EventContext, _ faas.EventHandler) (*faas.EventContext, error) {
    fmt.Println("archiving data")

    return ctx, nil
  })

  nitric.Run()
}
```
